package com.fangda.network;

import com.fangda.network.util.ByteUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;

/**
 * 网络组件中消息体
 * @author 赵方方
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class NetworkMessage implements Serializable {

    /**
	 * 
	 */
	private static final long serialVersionUID = -2297831107821551407L;
	/**
     * 消息体
     */
    private byte[] payload;

    private String remoteAddress;

    @Override
    public String toString() {
        return ByteUtil.byteArrayToHexString(payload);
    }
}
